<?php
		$kboy_user = $_SESSION['kboy_user'];
		$kboy_userid = $_SESSION['kboy_userid'];
?>
    <div class="top-bar">
        <div class="content">
            <div class="bar-l">
                <span>您好，欢迎访问中国徒步网</span>&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="http://new.chinawalking.net.cn" target="_blank" style="color: #194C8E;font-weight: 700;font-size: 16px;">
                    旧网站入口
                </a>
            </div>
            <div class="bar-r">
                <div class="bar-r-con">
                    <ul class="bar-r-con-list">
                        <li class="li-sanjiao down-menu">
                            <a href="user_index.php" class="left-ico-a">
                                <span>个人中心</span>
                                <span class="rect ico"></span>
                            </a>
                            <ul class="sencond-menu">
                                <li><a href="#">我报名的活动</a></li>
                            </ul>
                        </li>
                        <!--<li>
                            <a  href="javascript:void(0)" onclick="SetHome(this)"  >
                                <span>设为首页</span>
                            </a>
                        </li>-->
                        <li>
                            <a href="javascript:void(0)" onclick="AddFavorite(window.location,document.title)">
                                <span>收藏本站</span>
                            </a>
                        </li>
                        <li class="sina">
                            <a href="api/weibo/">
                                <span class="ico-link ico-xl"></span>
                            </a>
                        </li>
                        <li class="qq">
                            <a href="api/oauth/">
                                <span class="ico-link ico-qq"></span>
                            </a>
                        </li>
                        <li class="login-bar">
							<?php
									if($kboy_user){
										echo "欢迎您：<a href=\"forum_news.php?uid=".$kboy_userid."\">".getUserNickName($kboy_userid)."</a> | <a href=\"user_logout.php?action=logout\">退出</a>";	
									}else{
										echo "<a href=\"reg.php\">注册</a> | <a href=\"login.php\">登录</a>";
									}
							?>
                        </li>
                        <li class="tel">
                            <a href="javascript:;" class="f-ico-a">
                                <span class="ico-tel ico"></span>
                                <span><?=$index_mk3?></span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
	<script type="text/javascript">
	//设为首页

			function SetHome(obj){
				try{
					obj.style.behavior='url(#default#homepage)';
					obj.setHomePage("<?php  echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>");
				}catch(e){
					if(window.netscape){
						try{
							netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
						}catch(e){
							alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
						};
					}else{
						alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'<?php  echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>'设置为首页。");
					};
				};
			};
       //加入收藏 
           function AddFavorite(sURL, sTitle) {               
		    sURL = encodeURI(sURL);          
			try{                 
			  window.external.addFavorite(sURL, sTitle);               }
			  catch(e) {               
			      try{                    
				     window.sidebar.addPanel(sTitle, sURL, "");                   }
					 catch (e) {                     
					   alert("加入收藏失败，请使用Ctrl+D进行添加,或手动在浏览器里进行设置.");      
					   }             
			  }    
		    } 
	</script>
